package com.wangjw.seckill.service;

import com.wangjw.seckill.dao.UserDao;
import com.wangjw.seckill.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by wangjw on 18/1/5.
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    public User getById(int id) {
        return userDao.getById(id);
    }

//    @Transactional
    public boolean tx() {
        User user1 = new User(1003, "wangmz");
        userDao.insert(user1);

        User user2 = new User(1002, "nijj");
        userDao.insert(user2);

        return true;
    }

}
